/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package com.xiashitech.agent.instrumentation.dubbo.common.inst;


import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapGetter;

public enum DubboHeadersGetter implements TextMapGetter<DubboRequest> {
  INSTANCE;

  @Override
  public Iterable<String> keys(DubboRequest request) {
    return request.getInvocation().getAttachments().keySet();
  }

  @Override
  public String get(DubboRequest request, String key) {
    return request.getInvocation().getAttachment(key);
  }
}
